package com.kai.Mapper;

import com.kai.Pojo.Books;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BookMapper {

    //增加一个Book
    int addBook(Books books);

    //根据id删除一个Book @Param起个和数据库列名相同的别名让
    int deleteBookById(@Param("bookId") int id);

    //更新Book
    int updateBook(Books books);

    //根据id查询,返回一个Book
    Books queryBookById(@Param("bookId")int id);

    //查询全部Book,返回list集合
    List<Books> queryAllBook();

    //模糊查询根据书名
    List<Books> queryBookName(String bookName);
}
